#include <stdio.h>
#include <string.h>

#define NMAX 500000


void
Merge(int* a, int L, int M, int R)
{
	register int i = L,
		     j = M+1,
		     s = 0; /* index. points to where we will place next element */
	int sorted[NMAX];

	while (i <= M || j <= R) {
		if (a[i] < a[j]) {
			if 	(i <= M)
				sorted[s++] = a[i++];
			else if (j <= R)
				sorted[s++] = a[j++];
		} else {
			if 	(j <= R)
				sorted[s++] = a[j++];
			else if (i <= M)
				sorted[s++] = a[i++];
		}
	}

	i = 0;
	while (i < s) {
		a[L + i] = sorted[i];
		++i;
	}
}



void
Merge_sort(int* a, int L, int R)
{
	int M;
	if (L < R) {
		M = (L + R) / 2;

		Merge_sort(a, L, M);
		Merge_sort(a, M+1, R);

		Merge(a, L, M, R);
	}
}



int
main(void)
{
	int n, array[NMAX];
	register int i = 0;
	freopen("merge.in", "rt", stdin);
	freopen("merge.out", "w", stdout);

	(void)scanf("%d\n", &n);
	while (i<n)
		(void)scanf("%d", &array[i++]);

	Merge_sort(array, 0, n-1);
	i = 0;
	while (i<n)
		printf("%d ", array[i++]);
	putchar('\n');
	return 0;
}
